#include "Common.h"
#include "RenderView.h"
#include "Renderable.h"
#include "RenderTarget.h"
#include "Camera.h"


RenderView::RenderView(Scene* scene, Camera* camera, RenderTarget* renderTarget)
	: ScenePtr(scene)
	, CameraPtr(camera)
	, RTT(renderTarget)
	, ViewX(0)
	, ViewY(0)
	, ViewWidth(renderTarget->getWidth())
	, ViewHeight(renderTarget->getHeight())
	, ViewMatrix(camera->getViewMatrix())
	, ProjectionMatrix(camera->getProjectionMatrix())
	, ViewProjMatrix(camera->getViewMatrix() * camera->getProjectionMatrix())
{
}

void RenderView::AddRenderable(Renderable* rend)
{
	VisibilityMap(rend->getSceneID()) = true;
}